From: Wei Liu Date: Sun, 12 Jun 2016 14:09:50 +0000 (+0100) Subject: libxl: fix an error path that uses uninitialised rc in libxl_set_memory_target X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~905 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:///%22http:/www.example.com/cgi/%22https:/?a=commitdiff_plain;h=0630892fafe87ff5e3b65422d38158de46db3ed0;p=xen.git libxl: fix an error path that uses uninitialised rc in libxl_set_memory_target ecdc6fd8 ("libxl: Fix libxl_set_memory_target return value") failed to initialised rc in one failure path. Fix it in this patch. Also fixed an indentation issue while I was there. CID: 1362695 Signed-off-by: Wei Liu Acked-by: Ian Jackson --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 5ec4c80249..1c81239303 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -4927,10 +4927,12 @@ retry_transaction: target = libxl__xs_read(gc, t, GCSPRINTF("%s/memory/target", dompath)); if (!target && !domid) { - if (!xs_transaction_end(ctx->xsh, t, 1)) + if (!xs_transaction_end(ctx->xsh, t, 1)) { + rc = ERROR_FAIL; goto out_no_transaction; + } lrc = libxl__fill_dom0_memory_info(gc, ¤t_target_memkb, - ¤t_max_memkb); + ¤t_max_memkb); if (lrc < 0) { rc = ERROR_FAIL; goto out_no_transaction; } goto retry_transaction; } else if (!target) {